<?php
$wizardName = 'seminarWizard';
if ($this instanceof ViseminWizard_Controller) {
    $wizardName = 'viseminWizard';
}

echo '<div id="contentBlock">';

html::printPath(
    array($wizardName . '.form-title' => 'admin/' . $wizardName . '/step', $wizardName . '.' . $this->data->step . '-header' => ''),
    $wizardName . '.' . $this->data->step . '-desc'
);
$msg->printMessages();

$stepIndicator = new View('/admin/' . $wizardName . '/stepIndicator');
$stepIndicator->render(TRUE);

$mainSubview->render(true);
echo '</div>';

echo '<div id="wizardButtonsBlock">';
if ($this->wizardButtonsForm) {
    $this->wizardButtonsForm->write();
}
else {
    $fb = new FormBuilder(null, null);
    $wizardButtons = $fb->wizardButtons('/admin/' . $wizardName);
    if ($this->data->step == SeminarWizardData::$STEPS[0]) {
        // First step
        $wizardButtons->restartEnabled(FALSE)->previousEnabled(FALSE);
    }
    if ($this->data->step == SeminarWizardData::$STEPS[count(SeminarWizardData::$STEPS) - 1]) {
        // Last step
        $fb->setAction('finish');
        $wizardButtons->nextEnabled(FALSE)->finishEnabled(TRUE);
    }
    else {
        $fb->setAction('next');
    }
    $fb->write();
}
echo '</div>';
